package com.shardingdemo.webmvcConfig;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.shardingdemo.aop.RequestShardValueHolder;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;


/**
 */
public class RequestShardValueInterceptor extends HandlerInterceptorAdapter {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
      //  RequestShardValueHolder.set("ds0");
        return true;
    }

    @Override
    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
     //   RequestShardValueHolder.remove();
    }

}
